package org.example.testdemo.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.validation.annotation.Validated;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("declare1")
public class Declare {
    @TableId(value = "declareId",type = IdType.ASSIGN_UUID)
    private String declareId;//报销单号

    @TableField("declareName")
    @NotNull(message = "请输入申报事项")
    private String declareName;//申报事项

    @TableField("pId")
    @NotNull(message = "请选择需要申报的项目")
    private String pId;//项目编号

    @TableField("money")
    @NotNull(message = "请输入需要报销的金额")
    private BigDecimal money;//报销金额

    @TableField("yearId")
    private String yearId;//会计年度

    @TableField("intervalId")
    private String intervalId;//会计区间

    @TableField("state")
    private Integer state = 1;//状态

    @TableField("userId")
    private String userId;//填报人

    @TableField("reviewer")
    private String reviewer;//审核人

    @TableField("phone")
    @NotNull(message = "请输入申报人的手机号")
    @Pattern(regexp = "^1[3-9]\\d{9}$",message = "请输入正确的手机号")
    private String phone;//手机号码

    @TableField("supplement")
    @NotNull(message = "请输入申报说明")
    private String supplement;//申报说明

    @TableField("creationTime")
    private LocalDateTime creationTime;//创建时间

    @TableField("changeTime")
    private LocalDateTime changeTime;//修改时间

}
